<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$goods_info.goods_name}</title>

    <link rel="stylesheet" href="/templates/index/vendors/font-awesome/4.5.0/css/font-awesome.min.css">
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/??sm.min.css,sm-extend.min.css">
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/??sm.min.js,sm-extend.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="/templates/index/css/goods.css">
</head>
<body>
<div class="page-group">
    <div class="page page-current">
        <header class="bar bar-nav">
            <h1 class="title">Domall商城</h1>
        </header>
        <div class="content">
            <div class="buttons-tab">
                <a href="#tab1" class="tab-link active button">基本信息</a>
                <a href="#tab2" class="tab-link button">商品详情</a>
                <a href="#tab3" class="tab-link button">评价</a>
            </div>
            <div class="content-block">
                <div class="tabs">
                    <div id="tab1" class="tab active">
                        <div class="content-block">
                            <div class="swiper-container" data-space-between='10'>
                                <div class="swiper-wrapper">
                                    <div class="swiper-slide"><img src="//gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i1/TB1n3rZHFXXXXX9XFXXXXXXXXXX_!!0-item_pic.jpg_320x320q60.jpg" alt=""></div>
                                    <div class="swiper-slide"><img src="//gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i4/TB10rkPGVXXXXXGapXXXXXXXXXX_!!0-item_pic.jpg_320x320q60.jpg" alt=""></div>
                                    <div class="swiper-slide"><img src="//gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i1/TB1kQI3HpXXXXbSXFXXXXXXXXXX_!!0-item_pic.jpg_320x320q60.jpg" alt=""></div>
                                </div>
                                <div class="swiper-pagination"></div>
                            </div>
                            <div class="content-padded">
                                <h3>{$goods_info.goods_name}</h3>
                                <h4>¥{$goods_info.goods_marketprice}</h4>
                            </div>
                        </div>
                    </div>
                    <div id="tab2" class="tab">
                        <div class="content-block">
                            <p>{$goods_info.goods_body}</p>
                        </div>
                    </div>
                    <div id="tab3" class="tab">
                        <div class="content-block">
                            <p>评价</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <nav class="bar bar-tab">
            <a class="tab-item external active" href="/index">
                <span class="icon icon-home"></span>
                <span class="tab-label">首页</span>
            </a>
            <a class="tab-item external" href="#">
                <span class="icon icon-edit"></span>
                <span class="tab-label">我的订单</span>
            </a>
            <a class="tab-item external" id="addCart" href="#">
                <span class="icon icon-cart"></span>
                <span class="tab-label">加入购物车</span>
                <span class="badge" id="cart_info_price">¥{$cart_info_price ?? '0'}</span>
            </a>
            <a class="tab-item external" href="/index/cart">
                <span class="icon icon-check"></span>
                <span class="tab-label">立即结算</span>
            </a>
        </nav>

    </div>
</div>

<script>
    $.init();
    $(document).ready(function(){
       $('#addCart').click(function(){
           var id = '{$goods_info.goods_id}';
           $.post('/index/cart/add',{goods_id:id,quantity:1},function(result){
                if(result!=null){
                    $('#cart_info_price').text('¥'+result.cart_info_price);
                }
           },'json');
       });
    });
</script>
</body>
</html>